//
//  LSZPlaylistCollectionTableViewCell.m
//  JKFuYinProject
//
//  Created by 九酷 on 2018/5/25.
//  Copyright © 2018年 LC. All rights reserved.
//

#import "LSZPlaylistCollectionTableViewCell.h"

@implementation LSZPlaylistCollectionTableViewCell
-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        //70  80
        self.imageViewCoverCollection = [[UIImageView alloc]init];
        self.imageViewCoverCollection.contentMode = UIViewContentModeScaleAspectFill;
        self.imageViewCoverCollection.clipsToBounds = YES;
        [self addSubview:self.imageViewCoverCollection];

        self.labelTitle = [[UILabel alloc]init];
        self.labelTitle.textColor = titleColorLSZ;
        [LSZSpecialPackaging setLabel_14_5_Size:self.labelTitle];
        [self addSubview:self.labelTitle];

        self.numberSong = [[UILabel alloc]init];
        self.numberSong.textColor = lightColor;
        [LSZSpecialPackaging setLabelAdaptiveSize:self.numberSong font:13];
        [self addSubview:self.numberSong];

        self.labelTime = [[UILabel alloc]init];
        self.labelTime.textColor = lightColor;
        self.labelTime.textAlignment = NSTextAlignmentRight;
        [LSZSpecialPackaging setLabelAdaptiveSize:self.labelTime font:13];
        [self addSubview:self.labelTime];

        UIView * viewFen = [[UIView alloc]init];
        viewFen.backgroundColor = divider;
        [self addSubview:viewFen];
        if (ScreenWidth == 320) {
            //5
            self.imageViewCoverCollection.frame = CGRectMake(10,5,35,35);
            self.labelTitle.frame = CGRectMake(CGRectGetMaxX(self.imageViewCoverCollection.frame)+10,6,ScreenWidth-CGRectGetMaxX(self.imageViewCoverCollection.frame)-30,17);
            self.numberSong.frame = CGRectMake(CGRectGetMaxX(self.imageViewCoverCollection.frame)+10, CGRectGetMaxY(self.labelTitle.frame)+2,ScreenWidth-CGRectGetMaxX(self.imageViewCoverCollection.frame)-30,17);
            self.labelTime.frame = CGRectMake(CGRectGetMaxX(self.numberSong.frame),CGRectGetMaxY(self.labelTitle.frame)+2,ScreenWidth-CGRectGetMaxX(self.numberSong.frame)-20, 15);
            viewFen.frame = CGRectMake(20, 44.7, ScreenWidth, 0.3);
        }else if(ScreenWidth == 375){
            // 6 7
            self.imageViewCoverCollection.frame = CGRectMake(10,5,40,40);
            self.labelTitle.frame = CGRectMake(CGRectGetMaxX(self.imageViewCoverCollection.frame)+10,7.5,ScreenWidth-CGRectGetMaxX(self.imageViewCoverCollection.frame)-30,18);
            self.numberSong.frame = CGRectMake(CGRectGetMaxX(self.imageViewCoverCollection.frame)+10, CGRectGetMaxY(self.labelTitle.frame)+2,ScreenWidth/2-CGRectGetMaxX(self.imageViewCoverCollection.frame),18);
            self.labelTime.frame = CGRectMake(CGRectGetMaxX(self.numberSong.frame),CGRectGetMaxY(self.labelTitle.frame)+2,ScreenWidth-CGRectGetMaxX(self.numberSong.frame)-20,16);
            viewFen.frame = CGRectMake(20, 49.7, ScreenWidth, 0.3);
        }else {
            //plus
            self.imageViewCoverCollection.frame = CGRectMake(10,5,48,48);
            self.labelTitle.frame = CGRectMake(CGRectGetMaxX(self.imageViewCoverCollection.frame)+10,9.5,ScreenWidth-CGRectGetMaxX(self.imageViewCoverCollection.frame)-30,20);
            self.numberSong.frame = CGRectMake(CGRectGetMaxX(self.imageViewCoverCollection.frame)+10, CGRectGetMaxY(self.labelTitle.frame)+2,ScreenWidth/2-CGRectGetMaxX(self.imageViewCoverCollection.frame),20);
            self.labelTime.frame = CGRectMake(CGRectGetMaxX(self.numberSong.frame),CGRectGetMaxY(self.labelTitle.frame)+2,ScreenWidth-CGRectGetMaxX(self.numberSong.frame)-20,20);
            viewFen.frame = CGRectMake(20, 57.7, ScreenWidth, 0.3);
        }
    }
    return self;
}
@end
